<template>
  <div id="loginBox">
    <div class="input">
      <label>账户：</label>
      <input type="text" v-model="name" />
      <br />
      <label>密码：</label>
      <input type="password" v-model="password" />
    </div>

    <div class="ch">
      <input type="radio" name="type" value="超管" v-model="type" />
      <label>超管登陆</label>
      <input type="radio" name="type" value="商家" v-model="type" />
      <label>商家登陆</label>
    </div>

    <div>
      <button @click="login({name,password,type,ice})" >登录</button>
    </div>
  </div>
</template>

<script>
import axios from "axios";
import { request } from "../../network/request";
import { createNamespacedHelpers } from "vuex";
const { mapState, mapActions } = createNamespacedHelpers("login");
export default {
  data() {
    return {
      type: "超管",
      name: "",
      password: "",
      ice: true
    };
  },
  methods: {
    ...mapActions(["login"]),
  }
};
</script>

<style lang=less scope>
body {
  background: url(../../../public/img/login.jpg) no-repeat center;
  background-size: cover;
  opacity: 0.8;
}
#loginBox {
  width: 400px;
  height: 300px;
  border: 1px solid #ccc;
  overflow: hidden;
  margin: auto;
  margin-top: 180px;
  text-align: center;
  color: rgb(104, 142, 247);
  font-size: 16px;
  background-color: rgba(36, 35, 35, 0.8);
  padding-top: 60px;
  .input {
    margin-bottom: 20px;
    input {
      margin: 10px;
      width: 250px;
      height: 30px;
      border-radius: 6px;
      padding-left: 10px;
    }
  }
  .ch {
    input {
      margin-left: 10px;
      margin-bottom: 10px;
    }
  }
  button {
    width: 150px;
    height: 35px;
    margin-top: 20px;
    border-radius: 6px;
    font-size: 20px;
    color: rgb(21, 112, 61);
  }
}
</style>